package com.antler.smt.portal.controller;

import com.antler.smt.response.admin.GetUserListResp;
import com.antler.smt.response.base.Result;
import com.antler.smt.service.portal.StarLevelService;
import com.antler.smt.utils.LogUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 采购商获取星级
 *
 * @author zhangyi
 * @date 2018/4/27 15:24
 */
@RestController
@RequestMapping("/star")
@Api(description = "采购商获取星级")
public class StarLevelController extends BaseController{

    /**
     * 日志
     */
    private static Logger log = LogUtil.get();


    @Resource
    private StarLevelService starLevelService;

    /**
     * 根据消费金额充值金额算出星级
     *
     * @return
     */
    @GetMapping("/getStar")
    @ApiOperation(value = "根据消费金额充值金额算出星级", httpMethod = "GET")
    public Result<Integer> getStar(){

        Result result = null;
            result = starLevelService.getStar(currentMember.getId());
        return result;
    }

    /**
     * 根据消费金额充值金额算出还需多少金额
     *
     * @return
     */
    @GetMapping("/getNextStarMoney")
    @ApiOperation(value = "根据消费金额充值金额算出还需多少金额（接口不用了...）", httpMethod = "GET")
    public Result getNextStarMoney(){

        Result result = null;
            result = starLevelService.getNextStarMoney(currentMember.getId());
        return result;
    }
}
